<#include "common/common.html"/>
<meta charset="UTF-8">
<table
	     class="easyui-datagrid"   
	     id="datagrid"  
         title="用户管理"  
         url="${base}/realuser/list"
         toolbar="#toolbar" 
         rownumbers="true" 
         fitColumns="true"
         singleSelect="true"
         data-options="fit:false,border:false,pageSize:20,pageList:[5,10,15,20]" >  
    <thead>  
        <tr>
            <th field="id" width="5%" checkbox="true"></th>  
            <th field="login_name" width="35%">登录名</th>
            <th field="user_name" width="35%">昵称</th>   
            <th field="is_enabled" formatter="formatStatus" width="25%">是否可用</th>   
        </tr>  
    </thead>  
</table>  
<div id="toolbar">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:openNewDlg('用户添加','realuser/doadd','backendUser-dlg','backendUser-fm');">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="javascript:openEditDlg('用户修改','realuser/doupdate','backendUser-dlg','backendUser-fm');">修改</a>
</div>
<div id="backendUser-dlg" class="easyui-dialog"  style="padding:10px 20px" closed="true" modal="true" buttons="#backendUser-buttons">
        <form id="backendUser-fm" method="post">
           <div class="fitem">
                <label>登录账号:</label>
                <input id="loginName" name="login_name" maxlength="20" class="easyui-textbox" required="true" />(英文字母+数字)
           </div>
           <div class="fitem">
                <label>昵&nbsp;&nbsp;称::</label>
                <input id="userName" name="user_name" maxlength="20" class="easyui-textbox" required="true" />(中文+英文字母+数字)
           </div>
           <div class="fitem">
                <label>密&nbsp;&nbsp;码:</label>
                <input id="password" name="password" type="password" maxlength="20" class="easyui-textbox" required="true" />(英文字母+数字，6~20位)
           </div>
           <div class="fitem">
               <label>是否可用:</label>
               <select class="easyui-combobox" name="is_enabled" id="isEnabled" style="width:165px;" required="true">
		          <option value="1" selected="selected">可用</option>
		          <option value="0">不可用</option>
	            </select>
	        </div>
	        <div class="fitem">
               <label>角&nbsp;&nbsp;色:</label>
               <input class="easyui-combobox" name="role_id" id="roleId" required="true" style="width:165px;"
			     data-options="
				    url:'${base}/realuser/initRole',
				    valueField:'id',
				    textField:'name',
				    panelHeight:'auto',
				    editable:false" />
	        </div>
        </form>
</div>
<div id="backendUser-buttons">
    <a href="javascript:void(0)" id="saveBtn" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="javascript:submit('backendUser-dlg','backendUser-fm')" style="width:90px">提交</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#backendUser-dlg').dialog('close')" style="width:90px">取消</a>
</div>

<script type="text/javascript">
function formatStatus(val){
	if (val == 1){
		return '可用';
	} else {
		return '不可用';
	}
}
</script>
